package com.icon;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class datadis
 */
public class datadis extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public datadis() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		
		response.setContentType("text/html");
		PrintWriter out = response.getWriter();
		String submit = request.getParameter("submit");
		System.out.println("Button Value===========>");
		
		if (submit.equalsIgnoreCase("go")) {
			System.out.println("Method Called!!");
			String name;
			String years;
			String gender;
			String bod;
			String address = null;
			
			name = request.getParameter("name");
			years =request.getParameter("age");
			gender = request.getParameter("gender");
			bod = request.getParameter("bod");
			String adderss = request.getParameter("address");
			
			out.println("<table border='2'>");
			out.println("<tr>");
			out.println("<td>name</td>"+"<td>age</td>"+"<td>address</td>"+"<td>bod</td>"+"<td>gender</td>");
		    out.println("</tr>");
		    out.println("<tr>");
		    out.println("<td>"+name+"</td>"+"<td>"+years+"</td>"+"<td>"+address+"</td>"+"<td>"+bod+"</td>"+"<td>"+gender+"</td>");
		    out.println("</table>");
		    
	}
		
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}
